/**
* Copyright (c) 2008,中企动力华南研发中心
* All rights reserved.
*/
package com.ce.pms.custservice.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ce.pms.base.dao.impl.PmsBaseDaoImpl;
import com.ce.pms.custservice.dao.ICheckRecordDao;
import com.ce.pms.custservice.model.CheckRecordDO;
import com.ce.pms.custservice.vo.CheckRecordVO;
import com.sitechasia.webx.core.support.Page;


/***
 * 功能:抽检Dao实现类
 * @author 高嵩
 *
 */

public class CheckRecordDaoImpl extends PmsBaseDaoImpl<CheckRecordDO> implements ICheckRecordDao{


	/***
	    * 功能描述:  分页查询抽检登记<br>
	    * @param checkRecordVO
	    * @return Page
	    * @roseuid 494351DA015B
	    * Create author:高嵩 <br>
	    * Create on:2008-12-23  <br>
	    * Edit author:  <br>
	    * Edit on:    <br>
	    * Why:     <br>
	    */
	public Page queryCheckRecordByPage(CheckRecordVO checkRecordVO) {
		// TODO Auto-generated method stub
		 Map<String,Object> paramMap = new HashMap<String,Object>();

     		StringBuffer strBuf = new StringBuffer("from CheckRecordDO crdo where 1=1 ");
			if(null!=checkRecordVO.getCustomerServiceEventID()){
				strBuf.append(" and crdo.customerServiceEventDO.keyword = :keyword");
				paramMap.put("keyword", checkRecordVO.getCustomerServiceEventID());
			}
			 if(null!=checkRecordVO.getSortStr()&& !"".equals(checkRecordVO.getSortStr())){
				strBuf.append(" order by ").append(checkRecordVO.getSortStr()).append(" ");
			}else{
				//默认按事件编号排序
				strBuf.append(" order by crdo.sysInfo.sysDate DESC ");
			}
			return super.pagedNameQueryByPageNo(strBuf.toString(),
					checkRecordVO.getPageNo(),
					checkRecordVO.getPageSize(), paramMap);
	}




	  /***
	   * 功能描述:  查询抽检登记列表<br>
	   * @param checkRecordVO
	   * @return List<CheckRecordVO>
	   * @roseuid 494351DA0159
	   * Create author:高嵩 <br>
	   * Create on:2008-12-23  <br>
	   * Edit author:  <br>
	   * Edit on:    <br>
	   * Why:     <br>
	   */
	public List<CheckRecordVO> queryCheckRecordList(CheckRecordVO checkRecordVO) {
		// TODO Auto-generated method stub
		return null;
	}


}
